﻿@{
    string active = HttpContext.Current.Request.Path;
    string lang = string.Empty;
    if (!string.IsNullOrEmpty(Request.QueryString["lang"]))
    {
        lang = Request.QueryString["lang"];
    }
}
<nav>
    <div class="container">
        <ul>
            @*Home*@
            @if (active == "/")
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("index", "Home", new { lang = lang })">HOME</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.Home.Index())">HOME</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("index", "Home", new { lang = lang })">HOME</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.Home.Index())">HOME</a></li>
                }
            }

            @*about*@
            @if (active.Contains("/Home/About"))
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("About", "Home", new { lang = lang })">ABOUT US</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.Home.About())">ABOUT US</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("About", "Home", new { lang = lang })">ABOUT US</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.Home.About())">ABOUT US</a></li>
                }
            }

            @*Series*@
            @if (active.Contains("/Series"))
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("index", "Series", new { lang = lang })">SERIES</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.Series.Index())">SERIES</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("index", "Series", new { lang = lang })">SERIES</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.Series.Index())">SERIES</a></li>
                }
            }

            @if (active.Contains("/Competitors"))
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("Index","Competitors",new { lang = lang })">COMPETITORS</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.Competitors.Index())">COMPETITORS</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("Index", "Competitors", new { lang = lang })">COMPETITORS</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.Competitors.Index())">COMPETITORS</a></li>
                }
            }

            @if (active.Contains("/News"))
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("index", "News", new { lang = lang })">NEWS</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.News.Index())">NEWS</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("index", "News", new { lang = lang })">NEWS</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.News.Index())">NEWS</a></li>
                }
            }

            @if (active.Contains("/Results"))
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("Index", "Results", new { lang = lang })">RESULTS</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.Results.Index())">RESULTS</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("Index", "Results", new { lang = lang })">RESULTS</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.Results.Index())">RESULTS</a></li>
                }
            }

            @if (active.Contains("/Gallery"))
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("Index", "Gallery", new { lang = lang })">GALLERY</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.Gallery.Index())">GALLERY</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("Index", "Gallery", new { lang = lang })">GALLERY</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.Gallery.Index())">GALLERY</a></li>
                }
            }

            @if (active.Contains("/ContactUs"))
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li class="active"><a href="@Url.Action("Index", "ContactUs", new { lang = lang })">CONTACT US</a></li>
                }
                else
                {
                    <li class="active"><a href="@Url.Action(MVC.ContactUs.Index())">CONTACT US</a></li>
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(lang))
                {
                    <li><a href="@Url.Action("Index", "ContactUs", new { lang = lang })">CONTACT US</a></li>
                }
                else
                {
                    <li><a href="@Url.Action(MVC.ContactUs.Index())">CONTACT US</a></li>
                }
            }
        </ul>
    </div>
</nav>
